Skip to content

feat(active-minutes): judge a long pause by the hour of day - #42

Merged
Exploitacious merged 1 commit into
mainfrom
feat/active-minutes-work-hours
Nov 28, 2026
Merged

Exploitacious merged 1 commit into
mainfrom
feat/active-minutes-work-hours

Conversation

@Exploitacious

Copy link
Copy Markdown
Owner

What changed

bin/active-minutes now judges a long pause by the hour of day.

A pause over 30 minutes that ends with a prompt the Operator typed, with no other evidence:

  • counts as working time when it lies wholly inside work hours (Monday to Friday 07:00 to 18:00, both ends inclusive, start and end on the same date) and is no longer than --attended-max hours;
  • is assumed idle when any part falls outside work hours (a weekend, before or after the window, across midnight).

Both are defaults the agent overturns from the record with --keep and --drop, and each printed cause names the flag. New option --work-hours HH:MM-HH:MM (default 07:00-18:00) moves the hours; the weekdays stay fixed, and a value that is not a start before an end exits 2 with a message. The window is read in the display zone per timestamp, so a daylight-saving change needs no special case. Gaps of 30 minutes or less, background-task gaps, holds, stated breaks, harness-ended gaps, --also, --strict and --brief behave as before.

Files: .claude-config/bin/active-minutes, .claude-config/bin/tests/active-minutes-test.py, .claude-config/bin/README.md (the tool's section), CONTEXT/work-tracking.md (a "Measuring the time" line in the time example), CHANGELOG.md. SKILLS/harness/SKILL.md only points at the tool, so it is unchanged.

Why

A session transcript cannot tell a person working the task outside the chat from an agent parked on an approval. Counting every pause that a typed prompt ends, up to --attended-max, billed approval waits as work. The hour of day sets the default instead, and the agent decides from what the pause was waiting on.

How it was tested

  • python3 -B .claude-config/bin/tests/active-minutes-test.py: Ran 83 tests ... OK (also under sandbox-run --no-bind --no-net --ro-bind "$PWD", the CI form).
  • Red proof: the same test file against the unchanged tool: Ran 83 tests ... FAILED (failures=33), from 21 distinct tests: 17 of the 18 new cases, plus 4 existing ones the change touches (the overnight pause, the 4 hour ceiling, the docstring and the help text). The 18th new case, other gap causes on a Saturday night, is a regression guard and passes both ways. Against the new tool: all green.
  • New cases cover an in-hours pause, weekend, after-window end, before-window start, both ends outside, midnight crossing (with a window wide enough to hold both ends), a Friday to Monday pause, the 07:00 and 18:00 boundaries (and 18:00:30), the --attended-max ceiling inside work hours, --keep and --drop, --work-hours moving the window and rejecting ten bad values (also on a one-event transcript, exit 2), --brief, other gap causes unchanged on a Saturday night, and daylight saving on both sides of the fall and spring changes plus TZ and --tz-offset.
  • Existing cases changed: the overnight pause now reports "outside work hours" and a higher --attended-max no longer counts it (the hour decides, not the length); the 4 hour ceiling case also asserts the cause; the docstring and help cases name --work-hours. None deleted.
  • python3 -m py_compile on both files; python3 -B .claude-config/bin/tests/ci-gate-test.py: Ran 15 tests ... OK.
  • Fresh-install smoke test in a throwaway HOME (deploy twice, then verify-ops.sh): verify-ops: 30 ok · 0 warn · 0 fail.
  • .claude-config/bin/secrets-scan.sh CONTEXT SKILLS .claude-config: exit 0, no findings.
  • Private-term scan over the tree, the commit message and this body: zero block-level hits.

Models: Mythos 5.2 · T3 Code (Claude Code harness)

A session transcript cannot tell a person working the task outside the
chat from an agent parked on an approval, so counting every pause that a
typed prompt ends billed approval waits as work.

A pause over 30 minutes that ends with a typed prompt and has no other
evidence now counts when it lies wholly inside work hours (Monday to
Friday 07:00 to 18:00, both ends inclusive, start and end on the same
date) and still fits --attended-max. Any part outside them (a weekend,
before or after the window, across midnight) makes it assumed idle. Both
are defaults the agent overturns from the record with --keep and --drop,
and each printed cause names the flag.

New --work-hours HH:MM-HH:MM moves the hours (weekdays stay fixed, a bad
value exits 2). The window is read in the display zone per timestamp, so
a daylight-saving change needs no special case. Gaps of 30 minutes or
less, background-task gaps, holds, stated breaks, harness-ended gaps,
--also, --strict and --brief behave as before.
@Exploitacious
Exploitacious merged commit dc76e26 into main Nov 28, 2026
8 checks passed
@Exploitacious
Exploitacious deleted the feat/active-minutes-work-hours branch November 28, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant